#!/bin/bash
cd ~/app-root/data/index/img/Bing/
for((i=0;i<=9;i++));do
    curl -o Bing.jpg http://www.bing.com$(curl -s "http://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1" -H "Cookie: _EDGE_S=mkt=zh-cn"|grep -o "\/[a-zA-Z0-9\/\_\-]\{1,\}\.jpg" |sed 's#1920x1080#1366x768#')
    if ! diff -q Bing.jpg Bing${i}.jpg; then mv -f Bing.jpg Bing${i}.jpg;else rm -f Bing.jpg; fi
done
